package com.tedu.day04mybatis.mapper;

import com.tedu.day04mybatis.Pojo.Weibo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
    @Insert("INSERT INTO weibo(content,created,user_id) VALUES (#{content},#{created},#{userid})")
    int intinsert(Weibo weibo);
    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int deleteByid(Integer id);


    @Update("UPDATE weibo SET content=#{content},created=#{created},user_id=#{userid}")
    int updateByid(Weibo weibo);

    @Select("SELECT id,content,created,user_id userid FROM weibo WHERE id=#{id}")
    Weibo findById(Integer id);

    @Select("SELECT id,content,created,user_id userid FROM weibo")
    List<Weibo> findALl();
}
